/*     */ package btsm.servlet;
/*     */ 
/*     */ import btsm.bean.sqlCableWork;
/*     */ import java.io.IOException;
/*     */ import java.io.PrintStream;
/*     */ import javax.servlet.RequestDispatcher;
/*     */ import javax.servlet.ServletException;
/*     */ import javax.servlet.http.HttpServlet;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ 
/*     */ public class ser_FaultCable extends HttpServlet
/*     */ {
/*     */   public void init()
/*     */     throws ServletException
/*     */   {
/*     */   }
/*     */ 
/*     */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/*  23 */     sqlCableWork PC = new sqlCableWork("ocmalfunction", "");
/*     */ 
/*  25 */     String seraction = request.getParameter("seraction");
/*  26 */     String stroccode = request.getParameter("occode");
/*  27 */     String strsnid = request.getParameter("snid");
/*  28 */     String strToPage = request.getParameter("ToPage");
/*  29 */     if (strToPage == null) {
/*  30 */       strToPage = request.getParameter("tToPage");
/*     */     }
/*     */ 
/*  34 */     if (seraction.equalsIgnoreCase("serinsertsimple"))
/*     */     {
/*  36 */       String filesnames = request.getParameter("filesnames");
/*     */ 
/*  38 */       boolean result = PC.insertsimple(stroccode);
/*  39 */       if (result) {
/*  40 */         String msg = "";
/*  41 */         msg = msg + "新建光缆故障成功";
/*  42 */         request.setAttribute("msg", msg);
/*  43 */         filesnames = filesnames.replaceAll("list", "md");
/*  44 */         request.setAttribute("filesnames", "ser_FaultCable?seraction=sermodp&occode=" + stroccode + "&filesnames=" + filesnames);
/*     */ 
/*  46 */         RequestDispatcher btsm = request.getRequestDispatcher("common.jsp");
/*  47 */         btsm.forward(request, response);
/*     */       }
/*     */       else {
/*  50 */         String msg = "";
/*  51 */         msg = msg + "新建光缆故障失败";
/*  52 */         request.setAttribute("msg", msg);
/*  53 */         filesnames = filesnames.replaceAll("list", "md");
/*  54 */         request.setAttribute("filesnames", "ser_FaultCable?seraction=sermodp&occode=" + stroccode + "&filesnames=" + filesnames);
/*     */ 
/*  56 */         RequestDispatcher btsm = request.getRequestDispatcher("common.jsp");
/*  57 */         btsm.forward(request, response);
/*     */       }
/*     */     }
/*  60 */     else if (seraction.equals("seradd"))
/*     */     {
/*  62 */       String[] fieldsg = request.getParameterValues("T1");
/*     */ 
/*  64 */       String filesnames = request.getParameter("filesnames");
/*     */ 
/*  66 */       boolean result = PC.add(fieldsg);
/*  67 */       if (result) {
/*  68 */         String msg = "";
/*  69 */         msg = msg + "新建光缆成功";
/*  70 */         request.setAttribute("msg", msg);
/*  71 */         filesnames = filesnames.replaceAll("list", "md");
/*  72 */         request.setAttribute("filesnames", "ser_FaultCable?seraction=sermodp&occode=" + stroccode + "&filesnames=" + filesnames);
/*  73 */         request.setAttribute("occode", stroccode);
/*     */ 
/*  75 */         RequestDispatcher btsm = request.getRequestDispatcher("common.jsp");
/*  76 */         btsm.forward(request, response);
/*     */       }
/*     */       else {
/*  79 */         String msg = "";
/*  80 */         msg = msg + "新建光缆失败";
/*  81 */         request.setAttribute("msg", msg);
/*  82 */         filesnames = filesnames.replaceAll("list", "md");
/*  83 */         request.setAttribute("filesnames", "ser_FaultCable?seraction=sermodp&occode=" + stroccode + "&filesnames=" + filesnames);
/*  84 */         request.setAttribute("occode", stroccode);
/*     */ 
/*  86 */         RequestDispatcher btsm = request.getRequestDispatcher("common.jsp");
/*  87 */         btsm.forward(request, response);
/*     */       }
/*  89 */     } else if (seraction.equals("sermodp"))
/*     */     {
/*  91 */       String filesnames = request.getParameter("filesnames");
/*  92 */       filesnames = filesnames.replaceAll("list", "md");
/*  93 */       request.setAttribute("occode", stroccode);
/*  94 */       request.setAttribute("snid", strsnid);
/*  95 */       request.setAttribute("ToPage", strToPage);
/*  96 */       System.out.println("strToPageLGMODP:" + strToPage);
/*  97 */       if (strToPage == null)
/*  98 */         strToPage = "1";
/*  99 */       RequestDispatcher btsm = request.getRequestDispatcher("nnadd_FaultCable.jsp?ToPage=" + strToPage);
/* 100 */       btsm.forward(request, response);
/* 101 */     } else if (seraction.equals("serdel"))
/*     */     {
/* 103 */       String filesnames = request.getParameter("filesnames");
/* 104 */       filesnames = filesnames.replaceAll("list", "md");
/* 105 */       request.setAttribute("filesnames", "ser_FaultCable?seraction=sermodp&occode=" + stroccode + "&filesnames=" + filesnames);
/* 106 */       request.setAttribute("occode", stroccode);
/*     */ 
/* 108 */       boolean result = PC.delbyid(strsnid);
/* 109 */       if (result) {
/* 110 */         String msg = "";
/* 111 */         msg = msg + "光缆故障信息删除成功";
/* 112 */         request.setAttribute("msg", msg);
/*     */ 
/* 114 */         RequestDispatcher btsm = request.getRequestDispatcher("common.jsp");
/* 115 */         btsm.forward(request, response);
/*     */       } else {
/* 117 */         String msg = "";
/* 118 */         msg = msg + "光缆故障删除失败";
/* 119 */         request.setAttribute("msg", msg);
/*     */ 
/* 121 */         RequestDispatcher btsm = request.getRequestDispatcher("common.jsp");
/* 122 */         btsm.forward(request, response);
/*     */       }
/*     */     }
/* 125 */     else if (seraction.equals("sermod"))
/*     */     {
/* 129 */       PC.wheresw = strsnid;
/* 130 */       String[] fieldxg = request.getParameterValues("T1");
/* 131 */       String filesnames = request.getParameter("filesnames");
/* 132 */       filesnames = filesnames.replaceAll("md", "list");
/* 133 */       boolean result = PC.mdByID(fieldxg, strsnid);
/* 134 */       if (result) {
/* 135 */         String msg = "";
/* 136 */         msg = msg + "光缆故障信息修改成功";
/* 137 */         request.setAttribute("msg", msg);
/* 138 */         filesnames = filesnames.replaceAll("list", "md");
/* 139 */         request.setAttribute("filesnames", "ser_FaultCable?seraction=sermodp&occode=" + stroccode + "&filesnames=" + filesnames + "&snid=" + strsnid + "&ToPage=" + strToPage);
/* 140 */         request.setAttribute("occode", stroccode);
/* 141 */         request.setAttribute("ToPage", strToPage);
/*     */ 
/* 143 */         RequestDispatcher btsm = request.getRequestDispatcher("common.jsp");
/* 144 */         btsm.forward(request, response);
/*     */       } else {
/* 146 */         String msg = "";
/* 147 */         msg = msg + "光缆故障信息修改失败";
/* 148 */         request.setAttribute("msg", msg);
/* 149 */         filesnames = filesnames.replaceAll("list", "md");
/* 150 */         request.setAttribute("filesnames", "ser_FaultCable?seraction=sermodp&occode=" + stroccode + "&filesnames=" + filesnames + "&snid=" + strsnid + "&ToPage=" + strToPage);
/* 151 */         request.setAttribute("occode", stroccode);
/* 152 */         request.setAttribute("ToPage", strToPage);
/*     */ 
/* 154 */         RequestDispatcher btsm = request.getRequestDispatcher("common.jsp");
/* 155 */         btsm.forward(request, response);
/*     */       }
/*     */     }
/*     */   }
/*     */ 
/*     */   public void doPost(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/* 163 */     doGet(request, response);
/*     */   }
/*     */ 
/*     */   public void destroy()
/*     */   {
/*     */   }
/*     */ }

/* Location:           E:\java\apache-tomcat-6.0.36\webapps\btsm\WEB-INF\classes\
 * Qualified Name:     btsm.servlet.ser_FaultCable
 * JD-Core Version:    0.6.2
 */